package Object;

import Object类.Student;

public class ObjectDemo2 {
    public static void main(String[] args) {
        Student s=new Student();
        s.setName("姜恒星");
        s.setAge(20);

        Student s2=new Student();
        s2.setName("姜恒星");
        s2.setAge(20);

        //需求：比较两个对象内容是否相同
//        System.out.println(s == s2);
        System.out.println(s.equals(s2));
/*
        public boolean equals(Object obj) {
        //this --- s1
        //obj --- s2 地址值
            return (this == obj);
        }*/
    }
}
